<h1>Listing tokens</h1>

<h2>User: <%= @user.login %></h2>

<table>
  <tr>
    <th>Value</th>
    <th>Type</th>
    <th>Expires at</th>
    <th>&nbsp;</th>
  </tr>
  
<% for token in @tokens %>
<%   if token.still_valid? %>
<tr>
<%   else %>
<tr class="expired">
<% end %>
    <td><%= token.token_value %></td>
    <td><%= token.token_type %></td>
    <td><%= token.expires_at %></td>
    <td><%= link_to 'Delete', token_path(@user,token), :confirm => 'Are you sure?', :method => :delete, :href => delete_token_url(@user,token) %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New token', new_token_path(@user) %>
